<?php
namespace Admin\Controller;
use Think\Controller;

//自定义的，所有控制器的父类
class BaseindexController extends Controller
{
	//用户名
	public function _initialize(){
        //登录判断  BaseindexController
        $uid = $_COOKIE['wen_admin_userid'];
       
        if($uid){
            $admin_user_info = $_SESSION["admin_userinfo".$uid];
            
            // print_r($admin_user_info);
            if (!$admin_user_info) {
                setcookie("wen_admin_userid",'',time()-3600,'/');
                $this->redirect("login/login");
            }else{
                // echo 22;
                $this->assign("admin_user_info",$admin_user_info);  
            }
        }else{
            $this->redirect("login/login");
        }
        
        // print_r($_COOKIE);
        // echo MODULE_NAME,CONTROLLER_NAME,ACTION_NAME;
        //权限
	}
	//退出登录
	public function out(){
        $uid = $_COOKIE['wen_admin_userid'];
        $_SESSION['admin_userinfo'.$uid] = null;
        setcookie("wen_admin_userid",'',time()-3600,'/');
        // $this->redirect("login/login");
        $this->success('退出成功');
    }
    //修改密码
   

}


